import request from '@/utils/request'

export function getRoleList() {
  return request({
    url: '/web-api/system/role/all',
    method: 'get'
  })
}

export function getPage(query) {
  return request({
    url: '/web-api/system/role',
    method: 'get',
    params: query
  })
}

export function add(data) {
  return request({
    url: '/web-api/system/role',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: '/web-api/system/role',
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: '/web-api/system/role',
    method: 'put',
    data
  })
}

export function editMenu(data) {
  return request({
    url: '/web-api/system/role/menu',
    method: 'put',
    data
  })
}

export function getOne(id) {
  return request({
    url: '/web-api/system/role/' + id,
    method: 'get'
  })
}
